Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

tls: Destroy socket when encrypted side closes #5170

Closed
wants to merge 1 commit into from

Conversation

isaacs
Copy link

@isaacs isaacs commented Mar 30, 2013

The v0.8 Stream.pipe() method automatically destroyed the destination
stream whenever the src stream closed. However, this caused a lot of
problems, and was removed by popular demand. (Many userland modules
still have a no-op destroy() method just because of this.) It was also
very hazardous because this would be done even if { end: false } was
passed in the pipe options.

In v0.10, we decided that the 'close' event and destroy() method are
application-specific, and pipe() doesn't automatically call destroy().
However, TLS actually depended (silently) on this behavior. So, in this
case, we should just go ahead and destroy the thing when close happens.

Closes #5145

The v0.8 Stream.pipe() method automatically destroyed the destination
stream whenever the src stream closed.  However, this caused a lot of
problems, and was removed by popular demand.  (Many userland modules
still have a no-op destroy() method just because of this.) It was also
very hazardous because this would be done even if { end: false } was
passed in the pipe options.

In v0.10, we decided that the 'close' event and destroy() method are
application-specific, and pipe() doesn't automatically call destroy().
However, TLS actually depended (silently) on this behavior.  So, in this
case, we should just go ahead and destroy the thing when close happens.

Closes nodejs#5145
@Nodejs-Jenkins
Copy link

Thank you for contributing this pull request! Here are a few pointers to make sure your submission will be considered for inclusion.

Your commits have changes to lib or src but have no corresponding test or benchmark to go with them.

Please see CONTRIBUTING.md for more information

@ghost ghost assigned indutny Mar 30, 2013
@TooTallNate
Copy link

Hahah, nice @Nodejs-Jenkins!

@tjfontaine
Copy link

You get what you ask for

@isaacs
Copy link
Author

isaacs commented Apr 1, 2013

landed in v0.10.

@isaacs isaacs closed this Apr 1, 2013
@isaacs isaacs deleted the GH-5145 branch April 1, 2013 17:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants